# -*- coding: UTF-8 -*-
import yun_mqtt
import utime as time
import yun_network
import state_led

def main():
    state_led.led_disp_thread()
    ret = yun_network.connect_network()
    print("ret:",ret)
    if ret == True:
        yun_mqtt.mqtt_connect()
    else:
        print('network-connection failed')
    n= 0
    while True:
        n +=1
        if n > 70:
            yun_mqtt.update()
            n = 0
        time.sleep(1)
    

if __name__ == '__main__':
    main()
